<?php


namespace app\miniapp\controller\v3;


use app\common\lib\Jssdk;
use think\Controller;
use think\Env;

class WxShare extends Controller
{

    private $oss = '';
    private $domain = '';
    private $share_img = '';
    /**
     * @var Jssdk
     */
    protected $JSSDK;

    public function _initialize()
    {
        $this->JSSDK = new Jssdk();
        $this->oss = Env::get('host.photo');
        $this->domain = $this->oss;
        $this->share_img = $this->domain . '/static/video_share/images/share_logo.png';
    }

    public function getSignPackage()
    {
        if ($this->request->isGet())
        {
            $url = input('url', '');
            $signPackage = $this->JSSDK->getSignPackage($url);
            return json($signPackage);
        }
    }
}
